package com.hxkj.dao.impl;

import com.hxkj.dao.ContentDao;
import com.hxkj.mapper.ContentMapper;
import com.hxkj.domain.po.Content;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
 * 数据操作实现
 *
 * @author: chenwei
 * @version: 1.0
 * @datetime: 2018-09-10 12:05:02
 *
 */
@Service("contentDao")
public class ContentDaoImpl implements ContentDao {

    @Resource
    private ContentMapper contentMapper;

    @Override
    public Content get(Long id) {
        return contentMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Content> get(Content content) {
        return contentMapper.select(content);
    }

    @Override
    public int delete(Long id) {
        return contentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int delete(Content content) {
        return contentMapper.delete(content);
    }

    @Override
    public int save(Content content) {
        return contentMapper.insert(content);
    }

    @Override
    public int update(Content content) {
        return contentMapper.update(content);
    }

    @Override
    public List<Content> getContent(Content content) {
        return contentMapper.getContent(content);
    }

    @Override
    public int saveContent(Content content) {
        return contentMapper.saveContent(content);
    }

    @Override
    public int removeContentByArticleId(Long articleId) {
        return contentMapper.removeContentByArticleId(articleId);
    }
}
